import * as actionTypes from "./actionTypes";
import axios from 'axios';
import { fromJS } from 'immutable';
import "../../../api/mock.js";
export const serchFouce = () => ({
    type: actionTypes.serch_fouce
})
export const serchBlur = () => ({
    type: actionTypes.serch_blur
})
export const list = (data,pageSize) => ({
    type: actionTypes.history_list,
    data:fromJS(data),
    totalPage:Math.ceil(data.length/pageSize)
})
export const acmouseEnter = (data) => ({
    type: actionTypes.mouseEnter_type,
    data:data,
})
export const acgetOtherPage = (data) => ({
    type: actionTypes.getOtherPage_type,
    data:data,
})

export const getList = () => {
    return (dispatch)=>{
        console.log(11113)
        axios.post("/list.json").then(res1=>{
            let res=res1.data;
            if (res.status===200) {
                console.log("data,pageSize",res.data,6)
                console.log("data,pageSize",Math.ceil(res.data.length/6))
                dispatch(list(res.data,6))
            }
        })
    }
}
